from redis import StrictRedis

class Config :
    DEBUG=True
    SECRET_KEY = 'QlD0rO9Bw69ryXpxwG2fg6awmp+Qn7hyWqNVG3YWdf9ig4gTZ8b5JdqCLPDa51NILmjSvq6kXn08mGR7UIX7Jw=='
    # 配置数据库链接

    SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@localhost/python01'
    # 动态追踪修改
    SQLALCHEMY_TRACK_MODIFICATIONS = False

#     配置redis的主机端口
    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 6379
    SESSION_TYPE = 'redis'
#     实例化redis对象
    SESSION_REDIS = StrictRedis(host=REDIS_HOST,port=REDIS_PORT)
    # 对redis进行签名
    SESSION_USE_SIGNER =True
#     指定session过期时间
    PERMANENT_SESSION_LIFETIME  = 86400

class developmentConfig(Config):
    DEBUG = True
class productionConfig(Config):
    DEBUG = False
config = {
    'development':developmentConfig,
    'production':productionConfig
}
